﻿using BlockeyEssentials.Drawing;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BlockeyEssentials.ScreenSystem.ScreenTypes
{
    public class BackgroundScreen : Screen
    {
        public BackgroundScreen(ScreenManager oManager, string oPath) 
            : base(oManager)
        {
            Texture2D oTexture = oManager.Game.Content.Load<Texture2D>(oPath);
            Visible = true;
            Transition = 0.0f;
            TransitionRate = 1f / 60f;

            _Background = new SpriteR(oTexture, new Rectangle(0, 0, All.Resolution.Width, All.Resolution.Height));
            _Background.Layer = 0;
        }

        #region Methods

        public override void Draw(SpriteBatch oSB)
        {
            _Background.Draw(oSB, Transition);
        }

        #endregion

        SpriteR _Background;

    }
}
